#ifndef AESENCODE_H
#define AESENCODE_H
# include <stdio.h>
# include <stdint.h>
# include <cstring>
# define AES_SPLITE     4 
# define AHB_SLAVE_BASE 0xA0000000
# define AES_CTRL       0x00000000
# define AES_DATA       0x00000004
# define AES_OUT        0x00000014
# define AES_CMD_ENCODE  1 << 2
# define AES_CMD_KEYEXP  1 << 3
# define AES_STA_ENCODE  1 << 0
# define AES_STA_KEYEXP  1 << 1
extern uint32_t now_key[4];
#define SIM 

#ifdef SIM
    #include <verilated_vcd_c.h>
    #include "Vtop.h"
    // #define WR_DEBUG 
    #define TRANS_DEBUG
#endif

#ifdef SIM
extern unsigned int mytime;
extern VerilatedVcdC *fp;
extern Vtop *dut_ptr; 
#endif

/* abstract function */
void     write_reg(uint32_t addr,uint32_t data);
uint32_t read_reg (uint32_t addr);

void print128(uint32_t* p);

/* AES relate function */
void aes_128_keyexp(uint32_t* key);
void aes_128_encode(uint32_t* data , uint32_t* out);
void aes_128_caculate(uint32_t* data,uint32_t* key,uint32_t* out);

#ifdef SIM
void delay_cycle(int num);
#endif
#endif
